#pragma once

/*
@author: TriLVH
@description: Bulelt action
*/

#include "BulletData.h"
#include "BulletFireStrategy.h"
#include <cmath>

#define _BULLET_1_VX 4
#define _BULLET_1_VY 4

#define _BULLET_DIRECTION_LEFT 2
#define _BULLET_DIRECTION_UP_LEFT 6
#define _BULLET_DIRECTION_DOWN_LEFT 10
#define _BULLET_DIRECTION_RIGHT 7
#define _BULLET_DIRECTION_UP_RIGHT 21
#define _BULLET_DIRECTION_DOWN_RIGHT 35
#define _BULLET_DIRECTION_UP 3
#define _BULLET_DIRECTION_DOWN 5

/* Delta to check target */
#define _BULLET_DISTANCE_DELTA 20
class BulletBehavior {
protected:
	/* Data to map to entity */
	BulletData* _data;
	BulletFireStrategy * _fireStrategy;

	/* Set fire direction */

	virtual void setLeftDirection();

	virtual void setRightDirection();

	virtual void setUpDirection();

	virtual void setHalfUpDirection();

	virtual void setHalfDownDirection();

	virtual void setDownDirection();
public:
	BulletBehavior() {
	}

	/* Constructor to create mapping to entity data */
	BulletBehavior(BulletData* data);

	void setBulletData(BulletData*  data);

	/* Set Fire direction */
	void setNonTargetDirection();

	virtual void setHalfTargetDirection();

	/* Check fire from target */
	virtual void setTargetDirection();

	/* Update entity action */
	void update(long time);
};